package com.homeparking.manage.service.impl;

import java.util.List;
import com.homeparking.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homeparking.manage.mapper.ManageArticleMapper;
import com.homeparking.manage.domain.ManageArticle;
import com.homeparking.manage.service.IManageArticleService;

/**
 * 系统文章Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-10-29
 */
@Service
public class ManageArticleServiceImpl implements IManageArticleService 
{
    @Autowired
    private ManageArticleMapper manageArticleMapper;

    /**
     * 查询系统文章
     * 
     * @param articleId 系统文章主键
     * @return 系统文章
     */
    @Override
    public ManageArticle selectManageArticleByArticleId(String articleId)
    {
        return manageArticleMapper.selectManageArticleByArticleId(articleId);
    }

    /**
     * 查询系统文章列表
     * 
     * @param manageArticle 系统文章
     * @return 系统文章
     */
    @Override
    public List<ManageArticle> selectManageArticleList(ManageArticle manageArticle)
    {
        return manageArticleMapper.selectManageArticleList(manageArticle);
    }

    /**
     * 新增系统文章
     * 
     * @param manageArticle 系统文章
     * @return 结果
     */
    @Override
    public int insertManageArticle(ManageArticle manageArticle)
    {
        manageArticle.setCreateTime(DateUtils.getNowDate());
        return manageArticleMapper.insertManageArticle(manageArticle);
    }

    /**
     * 修改系统文章
     * 
     * @param manageArticle 系统文章
     * @return 结果
     */
    @Override
    public int updateManageArticle(ManageArticle manageArticle)
    {
        manageArticle.setUpdateTime(DateUtils.getNowDate());
        return manageArticleMapper.updateManageArticle(manageArticle);
    }

    /**
     * 批量删除系统文章
     * 
     * @param articleIds 需要删除的系统文章主键
     * @return 结果
     */
    @Override
    public int deleteManageArticleByArticleIds(String[] articleIds)
    {
        return manageArticleMapper.deleteManageArticleByArticleIds(articleIds);
    }

    /**
     * 删除系统文章信息
     * 
     * @param articleId 系统文章主键
     * @return 结果
     */
    @Override
    public int deleteManageArticleByArticleId(String articleId)
    {
        return manageArticleMapper.deleteManageArticleByArticleId(articleId);
    }
}
